// Created by Joe on 2017/7/17.

app.service(
    'WeatherService',
    [
        'config', 'RequestProxyService',
        function (config, RequestProxyService) {
            return {
                getWeatherPrediction: RequestProxyService.requestProxy('/app/getOwcInfo', {},
                    {station_Id: config.curCity.stationID},
                    function (resolve, info) {
                        resolve({
                            weather: info.result[0].contents,
                            time: info.result[0].time
                        });
                    }),
                getWeatherWarning: function (city, station) {
                    return RequestProxyService.requestProxy('/app/getOwcYujing', {},
                        {cityname: city, stationname: station},
                        function (resolve, info) {
                            resolve(info.result)
                        })();
                }
            };
        }
    ]
);